package com.aspose.cells;

class zccn extends zcdb {
   zccn() {
      this.d = 39;
   }

   void a(Name var1) throws Exception {
      byte var2 = 9;
      String var3 = var1.getText();
      int var8;
      if (var3 != null) {
         var8 = var2 + var3.length() * 2 + 4;
      } else {
         var8 = var2 + 4;
      }

      byte[] var4 = var1.b();
      byte[] var5 = null;
      if (var4 != null) {
         var5 = new byte[var4.length];
         if (var5 != null) {
            System.arraycopy(var4, 0, var5, 0, var4.length);
            var8 += var5.length;
         }
      } else {
         var8 += 8;
      }

      if (var1.getComment() != null) {
         var8 += var1.getComment().length() * 2 + 4;
      } else {
         var8 += 4;
      }

      if (var1.l() && !var1.k()) {
         if (var1.c() != null) {
            var8 += var1.c().length() * 2 + 4;
         } else {
            var8 += 4;
         }

         if (var1.d() != null) {
            var8 += var1.d().length() * 2 + 4;
         } else {
            var8 += 4;
         }

         if (var1.e() != null) {
            var8 += var1.e().length() * 2 + 4;
         } else {
            var8 += 4;
         }

         if (var1.f() != null) {
            var8 += var1.f().length() * 2 + 4;
         } else {
            var8 += 4;
         }
      }

      this.c = new byte[var8];
      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.a() & '\uffff'), 0, this.c, 0, 4);
      this.c[4] = var1.g();
      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getSheetIndex() - 1), 0, this.c, 5, 4);
      byte var6 = 9;
      byte[] var7 = new byte[]{-1, -1, -1, -1};
      int var9;
      if (var3 != null) {
         var9 = zcch.a(this.c, var6, var3);
      } else {
         System.arraycopy(var7, 0, this.c, var6, 4);
         var9 = var6 + 4;
      }

      if (var5 != null) {
         System.arraycopy(var5, 0, this.c, var9, var5.length);
         var9 += var5.length;
      } else {
         var9 += 8;
      }

      if (var1.getComment() != null) {
         var9 = zcch.a(this.c, var9, var1.getComment());
      } else {
         System.arraycopy(var7, 0, this.c, var9, 4);
         var9 += 4;
      }

      if (var1.l() && !var1.k()) {
         if (var1.c() != null) {
            var9 = zcch.a(this.c, var9, var1.c());
         } else {
            System.arraycopy(var7, 0, this.c, var9, 4);
            var9 += 4;
         }

         if (var1.d() != null) {
            var9 = zcch.a(this.c, var9, var1.d());
         } else {
            System.arraycopy(var7, 0, this.c, var9, 4);
            var9 += 4;
         }

         if (var1.e() != null) {
            var9 = zcch.a(this.c, var9, var1.e());
         } else {
            System.arraycopy(var7, 0, this.c, var9, 4);
            var9 += 4;
         }

         if (var1.f() != null) {
            zcch.a(this.c, var9, var1.f());
         } else {
            System.arraycopy(var7, 0, this.c, var9, 4);
            var9 += 4;
         }
      }

   }
}
